package tests;

import junit.framework.TestCase;

import org.junit.*;
import static org.junit.Assert.*; // Means we can just use methods as local
import database.Database;

public class DatebaseTest extends TestCase{
		
	/**
	* Tests whether the database successfully connects
	*/
	@Test
	public void testSuccessfulConnection() {
		Database d = new Database("PloggData.db");
		assertTrue(d.openDatabase());
	}
	
	/**
	 * This test fails so it needs to be fixed
	 */
	@Test
	public void testFailedConnection() {
		Database d = new Database("FakeDatabase.db");
		assertFalse(d.openDatabase());
	}
	
	/*
	@Test
	public static void connectToDatabase() throws Exception {
		Database.connectToDatabase();		
	}
	
	@Test
	public static void retrievePloggIDs() throws Exception {
		Database.getAllDevices();		
	}
	
	@Test
	public static void setPloggsName() throws Exception {
		Database.setPloggName("Living room", "OO:12:6C:8B:3A");
	}
	
	@Test
	public static void registerNewPlogg() throws Exception {
		Database.registerNewPlogg(new Plogg("6C:B2:1C:8A:2C"));
	}
	
	@Test
	public static void findPloggDevice() throws Exception {
		Plogg p = Database.findPloggDevice("OO:12:6C:8B:3A");
		assertEquals("OO:12:6C:8B:3A", p.getID());
	}
		
	@Test
	public static void setPloggName() throws Exception {
		Database.setPloggName("Living room", "OO:12:6C:8B:3A");
	} */
}
